GenerativeComponents Help

Transpose

Returns a new list comprising all members of the given rectangular (non jagged) list.

object[] Transpose(object[] list)

How to use it

a) By default, the Transpose function automatically pre-balances the list to depth 2, before applying the transposition.

{a, {b, c}}.Transpose() produces the list {{a, b}, {a,
c}}

b) Transpose takes an optional integer argument that specifies the maximum depth of the transposition.

If the value is greater than 2, the transposition is applied recursively to the specified depth (and the list is pre-balanced to that depth).

{{{a, b}, {c, d}}, {{e, f}, {g, h}}}.Transpose() produces
the list {{{a, b}, {e, f}}, {{c, d}, {g, h}}}

However, if a depth is specified, the same list is transposed recursively to a deeper level.

{{{a, b}, {c, d}}, {{e, f}, {g, h}}}.Transpose(3) produces
the list {{{a, e}, {b, f}}, {{c, g}, {d, h}}}